const express = require('express');
const router = express.Router();
const { asyncHandle } = require('../getSendResult');
const { updateUserinfo } = require('../../services/userinfo');

/**
 * 更新用户信息
 */
router.post("/updateUserinfo", asyncHandle(
    async (req, res, next) => {
        const name = req.body.name;
        const age = req.body.age;
        const sex = req.body.sex;
        const adress = req.body.adress;
        const avatar = req.body.avatar;
        const Introduction = req.body.Introduction;
        const userId = req.id;
        return await updateUserinfo(name, age, sex, adress, avatar, Introduction, userId);
    }
))

module.exports = router;